<template>
	<page-meta :page-style="themeColor"></page-meta>
	<view :class="isIphoneX ? 'iphone-x' : ''">
		
		<view class="cf-container color-line-border" v-if="token">
			<view class="tab">
				<view @click="changeState(1)"><text :class="state == 1 ? 'color-base-text active color-base-border-bottom' : ''">平台商品</text></view>
				<view @click="changeState(2)"><text :class="state == 2 ? 'color-base-text active color-base-border-bottom' : ''">店铺商品</text></view>
				<view @click="changeState(3)"><text :class="state == 3 ? 'color-base-text active color-base-border-bottom' : ''">店铺信息</text></view>
			</view>
			 
		</view> 
			<mescroll-uni ref="mescroll" top="100" @getData="getShopGoods"  v-show="state==1"> 
				
				<block slot="list">
					<view class="categorylist">
						 <view class="categoryselect">
							 <view class="selcatname">一级分类：</view>
							 <view class="selcatpicker"   v-if="shop_category_one.length>0"><picker mode="selector" :range="shop_category_one" range-key="category_name"  @change="shopcatonechange" :value="shopcatoneindex" class="right">{{shop_category_one[shopcatoneindex].category_name}}</picker></view>
							 <view class="selcatname"   v-if="shop_category_two.length>0">二级分类：</view>
							 <view class="selcatpicker" v-if="shop_category_two.length>0"><picker mode="selector" :range="shop_category_two" range-key="category_name"  @change="shopcattwochange" :value="shopcattwoindex" class="right">{{shop_category_two[shopcattwoindex].category_name}}</picker></view>
							 <view class="selcatsearch" @click="searchgoods">搜索商品</view>
						 </view>
						  
					</view>
					<view class="coupon-listone">
						<view class="item" :class="['item',item.state != 1&&'item-disabled']" v-for="(item, index) in list" :key="index" @click="toGoodsList(item)" :style="{ backgroundColor: item.state != 1 ? '#FFF' : 'var(--main-color-shallow)' }">
							 <view class="goodsimage">
								 <image  :src="$util.img(item.goods_image)"></image>
							 </view>
							 <view class="goodsinfo">
								 <view class="goodsname">
									{{ item.goods_name }}
								 </view>
								 <view class="lineheight-clear">
								 	<view class="discount-price">
								 		<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
								 		<text class="price price-style large">{{ parseFloat(showPrice(item)).toFixed(2).split(".")[0] }}</text>
								 		<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split(".")[1] }}</text>
								 		
								 	</view>
								 	<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
								 		<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix"></image>
								 	</view>
								 	<view class="member-price-tag" v-else-if="item.promotion_type == 1">
								 		<image :src="$util.img('public/uniapp/index/discount.png')" mode="widthFix"></image>
								 	</view>
								 	
								 </view>
								 
								 <view class="pro-info">
								 	<view class="sale color-tip" style="float: left;width: 55%;margin-top: 3rpx;">库存:{{ item.stock }}</view>
								 	<view class="sale color-tip" style="float: right;width: 45%;text-align: right;">已售{{ item.sale_num }}{{ item.unit ? item.unit : '件' }}</view>
								 </view> 
								 
							 </view>
							 <view class="goodsbtn">
								 
								 <button v-if="item.isinstore==0" @click="uptomystor(item.goods_id)">上架</button> 
								 <text v-else>已上架</text>
								 <text v-if="item.isinstore==0" @click="setcheckup(item)" class="iconfont" :class="item.discount_config==1 ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></text>
							 </view>
						</view>
					</view>
					<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
						<ns-empty :isIndex="false"   text="暂无商品"></ns-empty>
					</view>
				</block>
			</mescroll-uni> 
			<mescroll-uni ref="mescroll_my" top="100" @getData="getStoreGoods"   v-show="state==2">
				<block slot="list">
					<view class="categorylist">
						 <view class="categoryselect">
							 <view class="selcatname">一级分类：</view>
							 <view class="selcatpicker"   v-if="store_category_one.length>0"><picker mode="selector" :range="store_category_one" range-key="category_name"  @change="storecatonechange" :value="storecatoneindex" class="right">{{store_category_one[storecatoneindex].category_name}}</picker></view>
							 <view class="selcatname"   v-if="store_category_two.length>0">二级分类：</view>
							 <view class="selcatpicker" v-if="store_category_two.length>0"><picker mode="selector" :range="store_category_two" range-key="category_name"  @change="storecattwochange" :value="storecattwoindex" class="right">{{store_category_two[storecattwoindex].category_name}}</picker></view>
							 <view class="selcatsearch" @click="searchgoods2">搜索商品</view>
						 </view>
						  
					</view>
					<view class="coupon-listone">
						<view class="item" :class="['item',item.state != 1&&'item-disabled']" v-for="(item, index) in list2" :key="index" @click="toGoodsList(item)" :style="{ backgroundColor: item.state != 1 ? '#FFF' : 'var(--main-color-shallow)' }">
							 <view class="goodsimage">
								 <image  :src=" item.goods_image "></image>
							 </view>
							 <view class="goodsinfo">
								 <view class="goodsname">
									{{ item.goods_name }}
								 </view>
								 <view class="lineheight-clear">
								 	<view class="discount-price">
								 		<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
								 		<text class="price price-style large">{{ item.myprice }}</text> 
								 		
								 	</view> 
								 	
								 </view>
								 
								 <view class="pro-info">
								 	<view class="sale color-tip" style="float: left;width: 55%;margin-top: 3rpx;">库存:{{ item.goods_stock }}</view>
								    
								 </view> 
								 
							 </view>
							 <view class="goodsbtn">
								 <text @click="setcheckup2(item)" class="iconfont" :class="item.discount_config==1 ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></text>
								 <button @click="delstoregoods(item.id)">下架</button>
								 <button @click="updatepriceshow(item)">改价</button>
								 <button class="commentbtn" v-if="item.indexshow==0" @click="commenttoindex(item.id,1)">推荐到首页</button>
								 <button class="commentbtn cancelbtn" v-else @click="commenttoindex(item.id,0)">取消首页推荐</button>
								 
								 
							 </view>
						</view>
					</view>
					<view v-if="!list.length && showEmpty2" class="margin-top cart-empty" :fixed="false">
						<ns-empty :isIndex="false"   text="暂无商品"></ns-empty>
					</view>
				</block>
			</mescroll-uni> 
		<view  class="storeinfo" v-show="state==3">
			 <view class="storedetail"> 
			  <view class="stitem">
			 	 店铺名称：{{storeinfo.shop_name}}
			  </view> 
			   <view class="stitem">
				    商品数量：{{storeinfo.goodscount}}
			   </view>
			   <view class="stitem">
			   	    订单数量：{{storeinfo.ordercount}}
			   </view>
			   <view class="stitem">
			   	    订单金额：{{storeinfo.ordermoney}}
			   </view> 
			   <view class="stitem">
			   	    店铺地址：{{shopurl}}
			   </view> 
			  <view class="stitem">
			  	    <button @click="copyUrl">复制店铺地址</button>
			  </view>
			  
			 </view>
		</view>
		<ns-login ref="ns-login"></ns-login>
		<loading-cover ref="loadingCover"></loading-cover>
		<uni-popup ref="changprice" type="center" class="changprice">
			<view class="changprice-popup"> 
				<view class="complete-wrap"> 
					请输入自己价格：<input type="text" placeholder="请输入价格" placeholder-class="placeholder" v-model="myprice" />
				</view>
				<view class="complete-footer">
					<button type="default" class="save-btn" @click="savetomystore">确定</button> 
				</view>
			</view>
		</uni-popup>
		<uni-popup ref="changprice2" type="center" class="changprice">
			<view class="changprice-popup"> 
				<view class="complete-wrap"> 
					请输入自己价格：<input type="text" placeholder="请输入价格" placeholder-class="placeholder" v-model="myprice2" />
				</view>
				<view class="complete-footer">
					<button type="default" class="save-btn" @click="updatestoreprice">确定</button> 
				</view>
			</view>
		</uni-popup>
		<uni-popup ref="changprice3" type="center" class="changprice">
			<view class="changprice-popup"> 
				<view class="complete-wrap"> 
					请输入自己价格比例%<input type="text" placeholder="请输入价格" placeholder-class="placeholder" v-model="myprice3" />
				</view>
				<view class="complete-footer">
					<button type="default" class="save-btn" @click="upalltostore">确定</button> 
				</view>
			</view>
		</uni-popup>
		<view v-show="selectedids.length>0&&showselect" class="selectedgoods">
			<view v-for="(sitem, sindex) in selectedids" :key="sindex" class="selectitem">
				{{sindex+1}},{{sitem.goods_name}}
				<text class="iconfont icon-delete itemdel" @click="delselecttiem(sitem,sindex)"></text>
			</view>
			<view class="goodsbtn">
			  <button @click="showallprice">批量上架</button>
			</view>
		</view>
		<view v-show="selectedids2.length>0&&showselect2" class="selectedgoods">
			<view v-for="(sitem, sindex) in selectedids2" :key="sindex" class="selectitem">
				{{sindex+1}},{{sitem.goods_name}}
				<text class="iconfont icon-delete itemdel" @click="delselecttiem2(sitem,sindex)"></text>
			</view>
			<view class="goodsbtn">
			  <button @click="showallprice2">批量下架</button>
			</view>
		</view>
	</view>
</template>

<script>
import store from '../../store';
export default {
	data() {
		return {
			type: '',
			types: '',
			state: 1,
			sort: 1,
			list: [],
			list2: [],
			isIphoneX: false, //判断手机是否是iphoneX以上
			token: null,
			showEmpty: false,
			showEmpty2: false,
			related_id: 0,
			storeinfo:[],
			shop_category_one:[],
			shop_category_two:[],
			store_category_one:[],
			store_category_two:[],
			shopcatoneindex:0,
			shopcattwoindex:0,
			storecatoneindex:0,
			storecattwoindex:0,
			myprice:0,
			myprice2:0,
			myprice3:0,
			curgoodsid:0,
			curstoregoodsid:0,
			shopurl:'',
			selectup:'',
			selectedids:[],
			selectedids2:[],
			showselect:true,
			showselect2:false
		};
	},
	onLoad(data) {
		
		if (data.related_id) this.related_id = data.related_id ? data.related_id : 0;
		this.isIphoneX = this.$util.uniappIsIPhoneX();
		 this.getCategoryOne();
		 this.getStoreInfo();
	},
	onShow() { 

		if (uni.getStorageSync('token')) {
			this.token = uni.getStorageSync('token'); 
			this.$api.sendRequest({
				url: '/api/memberproxy/info',
				data: {},
				success: res => {
					 
					let data = res.data;
					if (data != null) {
						 //console.log(".......................",data.status);  
						 let showtitle='';
						 if(data.status!=1){
							if(data.status==0){
														 showtitle='店铺审核中'
							}
							if(data.status==2){
								 showtitle='店铺已经被拒绝'
							}
							if(data.status==3){
								 showtitle='店铺已经被关闭'
							}
							this.$util.showToast({
											 			title: showtitle
											 		});		
							setTimeout(() => {
													this.$util.redirectTo('/pages/member/index');
							}, 1500) 
						 }
						 
					}else{
						this.$util.showToast({
							  title: '请先申请开通店铺'
						  });		
						setTimeout(() => {
							 this.$util.redirectTo('/pages/member/index');
						}, 1500)
					}
					if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
				},
				fail: res => {
					if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
				}
			});
			
		} else {
			this.$util.redirectTo('/pages_tool/login/login');
			return;
		}
	},
	methods: {
		//切换状态
		changeState(state) {
			this.state = state;  
			if(state==1){
				this.showselect=true;
				this.showselect2=false;
			}
			if(state==2){
				this.showselect=false;
				this.showselect2=true;
			}
			if(state==3){
				this.showselect=false;
				this.showselect2=false;
			}
		},
		changeSort(sort, types) {
			this.list = [];
			this.sort = sort;
			this.types = types;
			this.$refs.mescroll.refresh(false);
		},
		shopcatonechange(e){ 
			this.shopcatoneindex=e.detail.value;
			//console.log(".................",this.shop_category_one[e.detail.value].category_id) 
			if(this.shopcatoneindex>0){
				this.$api.sendRequest({
					url: '/api/memberproxy/getCategorytwo',
					data: {
						pid:this.shop_category_one[e.detail.value].category_id
					},
					success: res => {
						 
						this.shop_category_two=res.data;
					},
					fail: res => {
						 
					}
				});
			}
		
		},
		setcheckup(item){
			item.discount_config=!item.discount_config;
			//console.log(".................",JSON.stringify(item));
			if(item.discount_config){ 
				this.selectedids.push(item);
			}else{
				let index=0;
				this.selectedids.forEach((val, key) => {
					if (val == item) {
						this.selectedids.splice(key, 1);
					}
				});
			}
			//console.log(".................",JSON.stringify(this.selectedids));
		},
		
		setcheckup2(item){
			item.discount_config=!item.discount_config;
			//console.log(".................",JSON.stringify(item));
			if(item.discount_config){ 
				this.selectedids2.push(item);
			}else{
				let index=0;
				this.selectedids2.forEach((val, key) => {
					if (val == item) {
						this.selectedids2.splice(key, 1);
					}
				});
			}
			//console.log(".................",JSON.stringify(this.selectedids));
		},
		shopcattwochange(e){ 
			this.shopcattwoindex=e.detail.value;
		},
		delselecttiem(item,index){
			item.discount_config=0;
			this.selectedids.splice(index, 1);
		},
		delselecttiem2(item,index){
			item.discount_config=0;
			this.selectedids2.splice(index, 1);
		},
		storecatonechange(e){
			this.storecatoneindex=e.detail.value;
			//console.log(".................",this.shop_category_one[e.detail.value].category_id) 
			if(this.storecatoneindex>0){
				this.$api.sendRequest({
					url: '/api/memberproxy/getCategorytwo',
					data: {
						pid:this.store_category_one[e.detail.value].category_id
					},
					success: res => {
						 
						this.store_category_two=res.data;
					},
					fail: res => {
						 
					}
				});
			}
		
		},
		getStoreInfo(){
			this.$api.sendRequest({
				url: '/api/memberproxy/getStoreInfo',
				data: {},
				success: res => {
				 if(res.data==null){
				 		this.$util.showToast({
				 			title: '请先申请入住'
				 		});		
					  setTimeout(() => {
						this.$util.redirectTo('/pages/member/index');
					  }, 1000)
				 }else{
					this.storeinfo=res.data;
					this.shopurl=this.$config.h5Domain + '?id='+res.data.id; 
				 }
				  
				},
				fail: res => {
					 
				}
			});
		},
		storecattwochange(e){ 
			this.storecattwoindex=e.detail.value;
		},
		getCategoryOne(){
			this.$api.sendRequest({
				url: '/api/memberproxy/getCategoryone',
				data: {},
				success: res => {
					this.shop_category_one=[
						{					
							category_id:0,
							category_name:'全部'
						}
					]; 
					this.shop_category_one=this.shop_category_one.concat(res.data);
					this.store_category_one=[
						{					
							category_id:0,
							category_name:'全部'
						}
					]; 
					this.store_category_one=this.store_category_one.concat(res.data);
					
				},
				fail: res => {
					 
				}
			});
		},
		getShopGoods(mescroll) { 
		 
			this.showEmpty = false;
			var data = {
				page: mescroll.num,
				page_size: mescroll.size,
			};
			if(this.shop_category_one.length>0){
				data.category_id = this.shop_category_one[this.shopcatoneindex].category_id;
			}
			if(this.shop_category_two.length>0){
				data.category_id = this.shop_category_two[this.shopcattwoindex].category_id;
			}
			data.category_level = 1;
			this.$api.sendRequest({
				url: '/api/goodssku/page',
				data: data,
				success: res => {
					 this.showEmpty = true;
					 let newArr = [];
					 let msg = res.message;
					 if (res.code == 0 && res.data) {
					 	newArr = res.data.list;
					 } else {
					 	this.$util.showToast({
					 		title: msg
					 	});
					 }
					 mescroll.endSuccess(newArr.length);
					 //设置列表数据
					 if (mescroll.num == 1) {
					 	this.list = []; //如果是第一页需手动制空列表
					 	 
					 }
					 this.list = this.list.concat(newArr); //追加新数据
					 //console.log(".................",JSON.stringify(this.list)) 
					 if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
				},
				fail: res => {
					mescroll.endErr();
					if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
				}
			});
		},
		getStoreGoods(mescroll_my) {
			 
			this.showEmpty2 = false;
			var data = {
				page: mescroll_my.num,
				page_size: mescroll_my.size,
			};
			if(this.store_category_one.length>0){
				data.category_id = this.store_category_one[this.storecatoneindex].category_id;
			}
			if(this.store_category_two.length>0){
				data.category_id = this.store_category_two[this.storecattwoindex].category_id;
			}
			data.category_level = 1;
			//console.log(".................",JSON.stringify(data)) 
			this.$api.sendRequest({
				url: '/api/memberproxy/getMyStoreGoods',
				data: data,
				success: res => {
					  
					 this.showEmpty2 = true;
					 let newArr = [];
					 let msg = res.message;
					 if (res.code == 0 && res.data) {
					 	newArr = res.data.list;
					 } else {
					 	this.$util.showToast({
					 		title: msg
					 	});
					 }
					 mescroll_my.endSuccess(newArr.length);
					 //设置列表数据
					 if (mescroll_my.num == 1) {
					 	this.list2 = []; //如果是第一页需手动制空列表
					 	 
					 }
					 this.list2 = this.list2.concat(newArr); //追加新数据
					 if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
				},
				fail: res => {
					mescroll_my.endErr();
					if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
				}
			});
			 
		},
		searchgoods(){
			if (this.$refs.mescroll) this.$refs.mescroll.refresh();
		},
		searchgoods2(){
			if (this.$refs.mescroll_my) this.$refs.mescroll_my.refresh();
		},
		showPrice(data) {
			let price = data.discount_price;
			if (data.member_price && parseFloat(data.member_price) < parseFloat(price)) price = data.member_price;
			return price;
		},
		imageError(index) {
			this.list[index].logo = this.$util.getDefaultImage().goods;
			this.$forceUpdate();
		},
		toGoodsList(item) {
			if (item.state == 1) {
				this.$util.redirectTo('/pages/goods/list', {
					coupon: item.coupon_type_id
				});
			}
		},
		uptomystor(goods_id){
			//console.log("..............",goods_id);
			this.curgoodsid=goods_id;
			this.$refs.changprice.open(); 
		},
		savetomystore(){
			if (this.myprice == 0) {
				this.$util.showToast({
					title: '请输入价格'
				});
				return;
			}
			let data = {
					myprice: this.myprice,
					goods_id: this.curgoodsid 
				};
			this.$api.sendRequest({
				url: '/api/memberproxy/addtomystore',
				data: data,
				success: res => {
					this.flag = false;
			        this.$refs.changprice.close(); 
					if (res.code == 0) {
						this.$util.showToast({
							title: res.message
						}); 
						 
						//更新下两个方面数据
						if (this.$refs.mescroll) this.$refs.mescroll.refresh();
						if (this.$refs.mescroll_my) this.$refs.mescroll_my.refresh();
					} else {
						this.$util.showToast({
							title: res.message
						});
					}
				},
				fail: res => {
					this.$refs.changprice.close(); 
					this.flag = false;
				}
			});
		},
		
		showallprice(){
			this.$refs.changprice3.open(); 
		},
		upalltostore(){
			if (this.myprice3 == 0) {
				this.$util.showToast({
					title: '请输入价格比例'
				});
				return;
			}
			let selids='';
			this.selectedids.forEach((val, key) => {
				selids+=val.goods_id+",";
			});
			//console.log("..........",selids);
			let data = {
					mypriceper: this.myprice3,
					goods_ids:  selids 
				};
				console.log(".....................",JSON.stringify(data))
			this.$api.sendRequest({
				url: '/api/memberproxy/addtomystores',
				data: data,
				success: res => {
					console.log(".....................",JSON.stringify(res))
					this.flag = false;
			        this.$refs.changprice3.close(); 
					if (res.code == 0) {
						this.$util.showToast({
							title: res.message
						}); 
						 this.selectedids=[];
						//更新下两个方面数据
						if (this.$refs.mescroll) this.$refs.mescroll.refresh();
						if (this.$refs.mescroll_my) this.$refs.mescroll_my.refresh();
					} else {
						this.$util.showToast({
							title: res.message
						});
					}
				},
				fail: res => {
					this.$refs.changprice3.close(); 
					this.flag = false;
				}
			});
		},
		showallprice2(){
		
			let selids='';
			this.selectedids2.forEach((val, key) => {
				selids+=val.goods_id+",";
			});
			 
			
			 console.log("..........",selids);
			let data = { 
					goods_ids:  selids 
				};
			 
			this.$api.sendRequest({
				url: '/api/memberproxy/deltomystores',
				data: data,
				success: res => {
					console.log(".....................",JSON.stringify(res))
					 
			       
					if (res.code == 0) {
						this.$util.showToast({
							title: res.message
						}); 
						 this.selectedids2=[];
						//更新下两个方面数据
						if (this.$refs.mescroll) this.$refs.mescroll.refresh();
						if (this.$refs.mescroll_my) this.$refs.mescroll_my.refresh();
					} else {
						this.$util.showToast({
							title: res.message
						});
					}
				},
				fail: res => {
					 
				}
			});
		},
		delstoregoods(store_goods_id){
			let data = {
					id: store_goods_id  
				};
			uni.showModal({
				title: '提示',
				content: '确定要下架这个商品吗？',
				success: res => {
					if (res.confirm) {
						this.$api.sendRequest({
							url: '/api/memberproxy/delfrommystore',
							data: data,
							success: res => { 
								if (res.code == 0) {
									this.$util.showToast({
										title: res.message
									}); 
									 
									//更新下两个方面数据
									if (this.$refs.mescroll) this.$refs.mescroll.refresh();
									if (this.$refs.mescroll_my) this.$refs.mescroll_my.refresh();
								} else {
									this.$util.showToast({
										title: res.message
									});
								}
							},
							fail: res => {
								 this.$util.showToast({
								 	title: res.message
								 });
							}
						});
					}
				}
			});
		},
		updatepriceshow(item){
			//console.log("..............",goods_id);
			this.curstoregoodsid=item.id;
			this.myprice2=item.myprice;
			this.$refs.changprice2.open(); 
		},
		updatestoreprice(){
			if (this.myprice2 == 0) {
				this.$util.showToast({
					title: '请输入价格'
				});
				return;
			}
			let data = {
					myprice: this.myprice2,
					id: this.curstoregoodsid 
				};
			this.$api.sendRequest({
				url: '/api/memberproxy/updategoodsprice',
				data: data,
				success: res => {
					this.flag = false;
			        this.$refs.changprice2.close(); 
					if (res.code == 0) {
						this.$util.showToast({
							title: res.message
						});  
						//更新数据 
						if (this.$refs.mescroll_my) this.$refs.mescroll_my.refresh();
					} else {
						this.$util.showToast({
							title: res.message
						});
					}
				},
				fail: res => {
					this.$refs.changprice2.close(); 
					this.flag = false;
				}
			});
		},
		copyUrl() {
			let text = this.shopurl; 
			this.$util.copy(text, () => {
				this.$util.showToast({
					title: '复制成功'
				});
			});
		},
		commenttoindex(id,status){
			let data = { 
					id: id,
					status:status
				};
			this.$api.sendRequest({
				url: '/api/memberproxy/commenttoindex',
				data: data,
				success: res => { 
					if (res.code == 0) {
						this.$util.showToast({
							title: res.message
						});  
						//更新数据 
						if (this.$refs.mescroll_my) this.$refs.mescroll_my.refresh();
					} else {
						this.$util.showToast({
							title: res.message
						});
					}
				},
				fail: res => {
					 
				}
			});
		}
	},
	watch: {
		storeToken: function(nVal, oVal) {
			if (nVal) {
				this.token = nVal;
				this.$refs.mescroll.refresh();
			}
		}
	},
	computed: {
		storeToken() {
			return this.$store.state.token;
		}
	}
};
</script>

<style lang="scss" scoped>
.cart-empty {
	margin-top: 208rpx !important;
}

.active {
	border-bottom: 4rpx solid;
}

.coupon-head {
	display: flex;
	background: #fff;
	padding: 20rpx 50rpx;

	.sort {
		border: 2rpx solid #c5c5c5;
		padding: 1rpx 20rpx;
		border-radius: 10rpx;
		cursor: pointer;
		margin-right: 15rpx;
	}
}
.cf-container {
	background: #fff;
	overflow: hidden;
}

.tab {
	display: flex;
	justify-content: space-between;
	height: 86rpx;

	> view {
		text-align: center;
		width: 33%;
		height: 86rpx;

		text {
			display: inline-block;
			line-height: 86rpx;
			height: 80rpx;
			font-size: 30rpx;
		}
	}
}

.coupon-listone {
	margin: 0 30rpx;

	.item {
		display: block;
		background-color: #fff2f0;
		background-size: 100% 100%;
		border-radius: 20rpx;
		align-items: stretch;
		margin-top: $padding;
		overflow: hidden;
		padding:11rpx;
		.goodsimage{
		    display: block;
			width:19%; 
			float:left;
			image{
				width:120rpx;
				height:120rpx;
			}
		}
		.goodsinfo{
			display: block;
			 
			width:79%;
			float:right;
			
		}
		.goodsbtn{
			display: block;
			width:100%;
			 float:left;
			 button{
				 width:120rpx;
				 height:50rpx;
				 line-height:50rpx;
				 background-color: #ffcc00;
				 color:#ffffff;
				 display:inline-block;
			 }
			 .commentbtn{
				 width:220rpx;
			 }
			 .cancelbtn{
				 background-color: #c5c5c5;
			 }
		}

		 
	}
}
.categorylist{
	 
	.categoryselect{
		width:100%;
		.selcatpicker{
			margin-left:15rpx;
			display: inline-block; 
		}
		.selcatname{
			margin-left:15rpx;
			display: inline-block; 
		}
		.selcatsearch{
			margin-left:15rpx;
			display: inline-block; 
			border:solid 1px #999999;
			border-radius: 10rpx;
			padding:0px 8px;
		}
	}
}
.changprice{
	.changprice-popup{
		width:500rpx;
		height:300rpx;
		text-align:center;
		.complete-wrap{
			padding:30rpx;
		 
			input{
				margin:auto;
				width:200rpx;
				border:solid 1px #c5c5c5;
				border-radius: 10rpx;
				height:60rpx;
				line-height:60rpx;
			}
		}
	}
}
.storeinfo{
	padding:50rpx;
	.storedetail{
		
		height:700rpx;
		.stitem{
			height:80rpx;
			line-height:80rpx;
			button{
				background-color: #ffcc00;
				color:#ffffff;
				
			}
		}
		.shopurl{
			font-size:20rpx;
		}
	}
}
.selectedgoods{
	background-color: #f1f1f1;
	position: fixed;
	right:30rpx;
	top:10%;
	z-index: 2;
	padding:20rpx;
	width:350rpx;
	opacity: 0.9;
	border-radius: 10rpx;
	.itemdel{
		margin-left:5rpx;
		color:#ff4848;
	}
	 .goodsbtn{
		 margin-top:30rpx;
	 	text-align:center; 
	 	 button{
	 		 width:220rpx;
	 		 height:50rpx;
	 		 line-height:50rpx;
	 		 background-color: #ffcc00;
	 		 color:#ffffff;
	 		 display:inline-block;
	 	 }
	 	  
	 }
}

</style>
